package com.nalai.market.v1.controller;


import com.nalai.market.v1.service.IGoodsService;
import com.nalai.market.v1.vo.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author com.nalai
 * @since 2021-08-23
 */
@RestController
@RequestMapping("/v1/goods")
public class GoodsController {

    @Autowired
    private IGoodsService iGoodsService;

    @GetMapping("/findGoodsList")
    public List<GoodsVo> goodsList() {
        return iGoodsService.findGoodsVoList();
    }

    @GetMapping("/findGoodsById")
    public GoodsVo findGoodsById(Integer id){
        return iGoodsService.findGoodsById(id);
    }
}
